.class public Lrexsee/dialog/ImageDialog;
.super Lrexsee/core/widget/DivDialog;
.source "ImageDialog.java"


# instance fields
.field private mClickCallback:Ljava/lang/Runnable;

.field private final mDragListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

.field public final mView:Landroid/widget/ImageView;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "url"    # Ljava/lang/String;
    .param p3, "style"    # Ljava/lang/String;
    .param p4, "dragListener"    # Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    .prologue
    const/4 v0, 0x0

    .line 20
    invoke-direct {p0, p1, v0, p3}, Lrexsee/core/widget/DivDialog;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;)V

    .line 16
    iput-object v0, p0, Lrexsee/dialog/ImageDialog;->mClickCallback:Ljava/lang/Runnable;

    .line 21
    iput-object p4, p0, Lrexsee/dialog/ImageDialog;->mDragListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    .line 22
    new-instance v0, Landroid/widget/ImageView;

    iget-object v1, p0, Lrexsee/dialog/ImageDialog;->mContext:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    .line 23
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    sget-object v1, Landroid/widget/ImageView$ScaleType;->CENTER_INSIDE:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 24
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    invoke-virtual {p0, v0}, Lrexsee/dialog/ImageDialog;->addChild(Landroid/view/View;)V

    .line 25
    invoke-virtual {p0, p2}, Lrexsee/dialog/ImageDialog;->setImage(Ljava/lang/String;)V

    .line 26
    return-void
.end method


# virtual methods
.method protected onClick(Landroid/content/DialogInterface;)V
    .locals 1
    .param p1, "dialog"    # Landroid/content/DialogInterface;

    .prologue
    .line 51
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mClickCallback:Ljava/lang/Runnable;

    if-eqz v0, :cond_0

    .line 52
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mClickCallback:Ljava/lang/Runnable;

    invoke-interface {v0}, Ljava/lang/Runnable;->run()V

    .line 54
    :cond_0
    return-void
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 2
    .param p1, "keyCode"    # I
    .param p2, "event"    # Landroid/view/KeyEvent;

    .prologue
    const/4 v1, 0x1

    .line 30
    const/4 v0, 0x4

    if-ne p1, v0, :cond_2

    .line 31
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->menu:Lrexsee/core/menu/RexseeMenu;

    iget-boolean v0, v0, Lrexsee/core/menu/RexseeMenu;->isOptionsMenuOpen:Z

    if-eqz v0, :cond_0

    .line 32
    iget-object p0, p0, Lrexsee/dialog/ImageDialog;->mContext:Landroid/content/Context;

    .end local p0    # "this":Lrexsee/dialog/ImageDialog;
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->closeOptionsMenu()V

    move v0, v1

    .line 46
    :goto_0
    return v0

    .line 35
    .restart local p0    # "this":Lrexsee/dialog/ImageDialog;
    :cond_0
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->window_cancelable:Ljava/lang/String;

    const-string v1, "true"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lrexsee/dialog/ImageDialog;->dismiss()V

    .line 46
    .end local p0    # "this":Lrexsee/dialog/ImageDialog;
    :cond_1
    :goto_1
    const/4 v0, 0x0

    goto :goto_0

    .line 37
    .restart local p0    # "this":Lrexsee/dialog/ImageDialog;
    :cond_2
    const/16 v0, 0x52

    if-ne p1, v0, :cond_3

    .line 38
    iget-object p0, p0, Lrexsee/dialog/ImageDialog;->mContext:Landroid/content/Context;

    .end local p0    # "this":Lrexsee/dialog/ImageDialog;
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->openOptionsMenu()V

    goto :goto_1

    .line 39
    .restart local p0    # "this":Lrexsee/dialog/ImageDialog;
    :cond_3
    const/16 v0, 0x54

    if-ne p1, v0, :cond_4

    move v0, v1

    .line 40
    goto :goto_0

    .line 41
    :cond_4
    const/16 v0, 0x50

    if-eq p1, v0, :cond_1

    .line 42
    const/16 v0, 0x18

    if-eq p1, v0, :cond_1

    goto :goto_1
.end method

.method public setClickCallback(Ljava/lang/Runnable;)V
    .locals 0
    .param p1, "clickCallback"    # Ljava/lang/Runnable;

    .prologue
    .line 60
    iput-object p1, p0, Lrexsee/dialog/ImageDialog;->mClickCallback:Ljava/lang/Runnable;

    .line 61
    return-void
.end method

.method public setImage(Ljava/lang/String;)V
    .locals 2
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    .line 57
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    iget-object v1, p0, Lrexsee/dialog/ImageDialog;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-static {v1, p1}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 58
    return-void
.end method

.method public setStyle(Ljava/lang/String;)V
    .locals 5
    .param p1, "style"    # Ljava/lang/String;

    .prologue
    .line 64
    invoke-super {p0, p1}, Lrexsee/core/widget/DivDialog;->setStyle(Ljava/lang/String;)V

    .line 65
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->event_multitouch:Ljava/lang/String;

    const-string v1, "true"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 66
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    new-instance v1, Lrexsee/dialog/ImageMultiTouchListener;

    iget-object v2, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    iget-object v3, p0, Lrexsee/dialog/ImageDialog;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->distance_threshold:Ljava/lang/String;

    const/4 v4, 0x0

    invoke-static {v3, v4}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v3

    iget-object v4, p0, Lrexsee/dialog/ImageDialog;->mDragListener:Lrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;

    invoke-direct {v1, v2, v3, v4}, Lrexsee/dialog/ImageMultiTouchListener;-><init>(Landroid/widget/ImageView;ILrexsee/dialog/ImageMultiTouchListener$OnImageDragedOverThresholdListener;)V

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 71
    :goto_0
    return-void

    .line 68
    :cond_0
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    sget-object v1, Landroid/widget/ImageView$ScaleType;->CENTER_INSIDE:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 69
    iget-object v0, p0, Lrexsee/dialog/ImageDialog;->mView:Landroid/widget/ImageView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    goto :goto_0
.end method
